import i18n from '@/utils/i18n'
export const formItems = [
  {
    filed: 'ctId',
    type: 'select',
    labelCode: 'name',
    valueCode: 'id',
    label: i18n.t('message.ct'),
    options: []
  },
  {
    filed: 'goodName',
    type: 'input',
    label: i18n.t('message.cpmc')
  },
  {
    filed: 'time',
    type: 'daterange',
    clearable: false,
    label: i18n.t('message.rq'),
    pickerOptions: {
      shortcuts: [{
        text: i18n.t('message.jin7'),
        onClick(picker) {
          const end = new Date()
          const start = new Date()
          start.setTime(end.getTime() - 3600 * 1000 * 24 * 6)
          picker.$emit('pick', [start, end])
        }
      },
      {
        text: i18n.t('message.jin30'),
        onClick(picker) {
          const end = new Date()
          const start = new Date()
          start.setTime(end.getTime() - 3600 * 1000 * 24 * 29)
          picker.$emit('pick', [start, end])
        }
      },
      {
        text: i18n.t('message.jin60'),
        onClick(picker) {
          const end = new Date()
          const start = new Date()
          start.setTime(end.getTime() - 3600 * 1000 * 24 * 59)
          picker.$emit('pick', [start, end])
        }
      },
      {
        text: i18n.t('message.jin90'),
        onClick(picker) {
          const end = new Date()
          const start = new Date()
          start.setTime(end.getTime() - 3600 * 1000 * 24 * 89)
          picker.$emit('pick', [start, end])
        }
      }],
      disabledDate(time) {
        var curDate = new Date(new Date().toLocaleDateString()).getTime()
        var preDate = new Date(curDate + 24 * 60 * 60 * 1000 - 1)
        return time.getTime() > preDate
      }
    }
  },
  {
    filed: 'payMethod',
    type: 'select',
    label: i18n.t('message.zffs'),
    labelCode: 'name',
    options: []
  },
  {
    filed: 'memberInfo',
    type: 'input',
    label: i18n.t('message.memberInfo'),
    placeholder: i18n.t('message.hy2')
  },
  {
    filed: 'channelType',
    type: 'select',
    label: i18n.t('message.ddly'),
    options: [
      { value: '01', label: i18n.t('message.xcx') },
      { value: '02', label: i18n.t('message.cgpcd') }]
  },
  {
    filed: 'orderId',
    type: 'input',
    label: i18n.t('message.ddh')
  }
]
export const queryFormConfig = {
  formItems,
  online: true
}
